import request from "@/common/request";
import {IResponse} from "@/common/common";

export const userLogout = () => {
  return fetch(`/v3/thirdpart/sso/logout`, {
    method: 'DELETE',
  });
};

export const updataPassword = (params: any) => {
  return fetch(`/v3/normal/user/password`, {
    method: 'PUT',
    body: JSON.stringify(params),
  });
}

export const getPublicKey = () => {
  return fetch(`/v3/thirdpart/sso/publicKey`);
}

export const upUser = (params: any) => {
  return fetch(`/v3/normal/user`, {
    method: 'PUT',
    body: JSON.stringify(params),
  });
}

export const getDomainAccount = (domainAccount: string) => {
  return request(`/v3/normal/user/${domainAccount}/get`);
}

export function apiLogin(params: any): Promise<any> {
  return request({
    url: `/auth/login`,
    method: "POST",
    params,
  });
}

export function apiLogout() {
  return request({
    url: "/auth/login/logout",
    method: "POST",
  });
}
